home *** CD-ROM | disk | FTP | other *** search
/ ADA Programming Guide / ADA Programming Guide.iso / ada_gnu / include / pc.h < prev    next >
C/C++ Source or Header  |  1996-01-30  |  3KB  |  72 lines

  1. /*
  2. ** Copyright (C) 1991 DJ Delorie, 24 Kirsten Ave, Rochester NH 03867-2954
  3. **
  4. ** This file is distributed under the terms listed in the document
  5. ** "copying.dj", available from DJ Delorie at the address above.
  6. ** A copy of "copying.dj" should accompany this file; if not, a copy
  7. ** should be available from where this file was obtained.  This file
  8. ** may not be distributed without a verbatim copy of "copying.dj".
  9. **
  10. ** This file is distributed WITHOUT ANY WARRANTY; without even the implied
  11. ** warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  12. **
  13. ** Modified by J. Alan Eldridge, Liberty Brokerage, 77 Water St, NYC 10005
  14. **
  15. **    added getxkey(), which can read extended keystrokes that start with
  16. **    0xE0, as well as those which start with 0x00
  17. **    
  18. **    added global char ScreenAttrib, the attribute used by ScreenClear():
  19. **    it defaults to 0x07 so as not to break existing code.
  20. **
  21. **    added ScreenMode(), to return the current video mode
  22. */
  23.  
  24. #ifndef _PC_H_
  25. #define _PC_H_
  26.  
  27. #ifdef __cplusplus
  28. extern "C" {
  29. #endif
  30.  
  31. unsigned char inportb(unsigned short port);
  32. unsigned short inportw(unsigned short port);
  33. unsigned long inportl(unsigned short port);
  34. unsigned char inportsb(unsigned short port, unsigned char *buf, unsigned len);
  35. unsigned short inportsw(unsigned short port, unsigned short *buf, unsigned len);
  36. unsigned long inportsl(unsigned short port, unsigned long *buf, unsigned len);
  37. void outportb(unsigned short port, unsigned char data);
  38. void outportw(unsigned short port, unsigned short data);
  39. void outportl(unsigned short port, unsigned long data);
  40. void outportsb(unsigned short port, unsigned char *buf, unsigned len);
  41. void outportsw(unsigned short port, unsigned short *buf, unsigned len);
  42. void outportsl(unsigned short port, unsigned long *buf, unsigned len);
  43.  
  44. int kbhit(void);
  45. int getkey(void); /* ALT's have 0x100 set */
  46. int getxkey(void); /* ALT's have 0x100 set, 0xe0 sets 0x200 */
  47.  
  48. void sound(int frequency);
  49. #define nosound() sound(0)
  50.  
  51. extern unsigned char ScreenAttrib;
  52. extern short *ScreenPrimary;
  53. extern short *ScreenSecondary;
  54.  
  55. /* For the primary screen: */
  56. int ScreenMode(void);
  57. int ScreenRows(void);
  58. int ScreenCols(void);
  59. void ScreenPutChar(int ch, int attr, int x, int y);
  60. void ScreenSetCursor(int row, int col);
  61. void ScreenGetCursor(int *row, int *col);
  62. void ScreenClear(void);
  63. void ScreenUpdate(void *virtual_screen);
  64. void ScreenUpdateLine(void *virtual_screen_line, int row);
  65. void ScreenRetrieve(void *virtual_screen);
  66.  
  67. #ifdef __cplusplus
  68. }
  69. #endif
  70.  
  71. #endif
  72.